/* -------------------------------------------------------------------------- *
   TestWinUnit - Maria Blees (maria.blees@microsoft.com)
 * -------------------------------------------------------------------------- */
#include "MockLogger.h"

#include <string.h>

MockLogger::MockLogger()
        :
    OutputTestExecutableNamePreTestCalled(0),
    OutputTestExecutableNamePostTestCalled(0),
    OutputTestNamePreTestCalled(0),
    OutputTestNamePostTestCalled(0),
    OutputTraceCalled(0),
    OutputTestErrorCalled(0),
    OutputProgramErrorLineCalled(0),
    OutputFinalResultsCalled(0),
    Verbosity(0)
    {
    }

void MockLogger::OutputTestExecutableNamePreTest(
    const wchar_t* /* fullPath */, 
    const wchar_t* /* nameOfExecutable */)
{
    OutputTestExecutableNamePreTestCalled++;
}

void MockLogger::OutputTestExecutableNamePostTest(
    const wchar_t* /* fullPath */, 
    const wchar_t* /* nameOfExecutable */, 
    unsigned int /* succeeded */, 
    unsigned int /* totalRun */)
{
    OutputTestExecutableNamePostTestCalled++;
}

void MockLogger::OutputTestNamePreTest(const char* /* testName */)
{
    OutputTestNamePreTestCalled++;
}

void MockLogger::OutputTestNamePostTest(
    const char* /* testName */, 
    bool /* passed */)
{
    OutputTestNamePostTestCalled++;
}

void MockLogger::OutputTrace(const wchar_t* /* message */)
{
    OutputTraceCalled++;
}

void MockLogger::OutputTestError(const wchar_t* message)
{
    ::wcscpy_s(OutputTestError_message, sizeof(OutputTestError_message)/
        sizeof(OutputTestError_message[0]), message);
    OutputTestErrorCalled++;
}

void MockLogger::OutputProgramErrorLine(
    const wchar_t* msg1,
    const wchar_t* /* msg2 = 0 */,
    const wchar_t* /* msg3 = 0 */,
    const wchar_t* /* msg4 = 0 */)
{
    ::wcscpy_s(OutputProgramErrorLine_msg1, sizeof(OutputProgramErrorLine_msg1)/
        sizeof(OutputProgramErrorLine_msg1[0]), msg1);
    OutputProgramErrorLineCalled++;
}

void MockLogger::OutputFinalResults(
    unsigned int /* succeeded */, 
    unsigned int /* totalRun */)
{
    OutputFinalResultsCalled++;
}

void MockLogger::SetVerbosity(unsigned int verbosity)
{
    this->Verbosity = verbosity;
}